package com.lijin.batchsys.framework.enums;

public enum RunningStatus {
	
	RUNNING("0", "运行中"),
	COMPLETED("1", "已完成"),
	FAILED("2", "失败"),
	UNKNOWN("9", "未知");

	private String code;
	private String desc;
	
	private RunningStatus(String code, String desc) {
		this.code = code;
		this.desc = desc;
	}
	
	public static RunningStatus parseByCode(String code) {
		for (RunningStatus status : RunningStatus.values()) {
			if (status.getCode().equals(code)) {
				return status;
			}
		}
		return null;
	}

	public String getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
}
